home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d8 / nhost.arc / SCRIPT.SLT < prev    next >
Text File  |  1989-10-08  |  8KB  |  222 lines

  1. //    Note: _entry_pass is a system variable into which the
  2. //    dialing routines put whatever is in the password
  3. //    field of the dial directory entry being used.
  4.  
  5. str user_name[] = "User Name";            // Enter your name here
  6. str prodoor_loc[] = "Open 1";             // Command on this PCB
  7.                                           // to open ProDoor
  8. str want_graphics[] = "y";                // Want graphics on PCB
  9. str PCB_mailscan[] = "y";                 // Scan since last read
  10.                                           // on PCB
  11. str Uses_SEAdog[] = "n";                  // States whether Opus
  12.                                           // uses SEAdog
  13.  
  14. main()
  15.  
  16. {
  17.  int stat;                                // initiate track var
  18.  int t1,                                  // initiate individual
  19.      t2,                                  // track variables
  20.      t3,
  21.      t4,
  22.      t5,
  23.      t6,
  24.      t7,
  25.      t8,
  26.      t9,
  27.      t10,
  28.      t11,
  29.      t12,
  30.      t13,
  31.      t14,
  32.      t15,
  33.      t16;
  34. int mail_scan;                             // initiate WBBS timer
  35. int tmark;                                 // initiate script 
  36.                                            // timout timer
  37.  alarm(2);                                 // sound a connect    
  38.                                            // alarm, 2 secs
  39.  
  40.  if (not _entry_pass)
  41.   {
  42.    prints ("Sorry, I don't know the password for this BBS!");
  43.    return;
  44.   }
  45.  
  46.  t1 = track(" graphics", 1);         // definitions of what
  47.  t2 = track("first name", 1);        // strings to track
  48.  t3 = track("password", 1);
  49.  t4 = track("read it", 1);
  50.  t5 = track("More", 1);
  51.  t6 = track("continue", 1);
  52.  t7 = track("Command", 0);
  53.  t8 = track("█   █", 1);
  54.  t9 = track("Scan ", 1);
  55.  t10 = track("[Y,n]?", 0);
  56.  t11 = track("Select (", 1);
  57.  t12 = track("MAIN MENU:", 0);
  58.  t13 = track("[Y", 1);
  59.  t14 = track("Ctrl-K", 1);
  60.  t15 = track("MAIN command", 0);
  61.  t16 = track("WBBS", 1);
  62.  
  63.  if (uses_SEAdog == "y")                // If an Opus system on
  64.   {                                     // SEAdog, send a CR to
  65.    cputs("^M");                         // get the ball rolling
  66.   }
  67.  tmark = timer_start(2100);             // wait up to 3.5 minutes
  68.  
  69.  while (not time_up(tmark))             // track until time up
  70.   {
  71.    terminal();                          // let Telix process any
  72.                                         // chars and keys
  73.  
  74.    stat = track_hit(0);                 // see which (if any)
  75.                                         // was hit
  76.  
  77.    if (stat == t1)                      // say whether we want
  78.                                         // graphics in PCBoard
  79.     {
  80.      delay(5);                          // wait 1/2 second
  81.      cputs(want_graphics);              // send defined constant
  82.      cputs(" q^M");                     // don't display welcome
  83.     }
  84.    else if (stat == t2)                 // Found name prompt
  85.     {
  86.      delay(10);                         // let the BBS finish 
  87.      cputs(user_name);                  // send defined name
  88.      cputs("^M");                       // terminate string
  89.     }
  90.    else if (stat == t3)                 // Found password prompt
  91.     {
  92.      cputs(_entry_pass);                // Send password field
  93.      cputs("^M");                       // send <CR>
  94.     }
  95.    else if (stat == t5)                 // stop the "More:"
  96.                                         // prompt
  97.     {
  98.      delay(1);
  99.      cputs("N^M");                      // say NO to more
  100.     }
  101.    else if (stat == t10)                // Opus asked [Y,n]?
  102.     {
  103.      delay(1);
  104.      cputs("^M");                       // Tell Opus YES
  105.     }
  106.    else if (stat == t11)
  107.     {
  108.      delay(3);                          // Quit Opus Bulletins
  109.      cputs("^M");
  110.     }
  111.    else if (stat == t12)                // Found OPUS/Wildcat    
  112.                                     // MAIN menu
  113.     {
  114.      delay(20);                         // OPUS & Wildcat read
  115.      cputs("M^M^M");
  116.      break;                             // logon done, abort 
  117.     }
  118.    else if (stat == t13)                // say not to y/n prompt
  119.     {
  120.      delay(1);
  121.      cputs("N^M ");                     // change to say yes
  122.     }
  123.    else if (stat == t14)
  124.     {                                   // Abort RBBS stats
  125.      cputs("^K");
  126.     }
  127.    else if (stat == t15)
  128.     {
  129.      delay(1);
  130.      cputs("R^M");                      // Drop to RBBS msg base
  131.      break;
  132.     }
  133.    else if (stat == t16)                // WBBS complete script
  134.     {
  135.      cputs("^K");                       // abort from welcome scr
  136.      delay(10);
  137.      cputs(user_name);                  // send your name
  138.      cputs("^M");
  139.      delay(5);
  140.      cputs(_entry_pass);                // send your password
  141.      cputs("^M");
  142.      delay(10);
  143.      cputs("^C");                       // abort news file
  144.      mail_scan = timer_start(30);       // wait for new mail    
  145.                                         // prompt
  146.      while (not time_up(mail_scan))     
  147.       {
  148.        terminal();                      // begin input scan
  149.        stat = track_hit(0);             // track again
  150.        if (stat == t4)
  151.         {
  152.          cputs("y^M");                  // if mail, read it
  153.          break;                         // and break (abort)
  154.         }
  155.       }
  156.      if (time_up(mail_scan))            // if not found
  157.       {
  158.        cputs("z^M");                    // a ZIP read is done
  159.       }
  160.      break;                             // and then aborts
  161.     }
  162.    else if (stat == t6)                 // Continue prompt found
  163.     {
  164.      delay(1);
  165.      cputs("^M");                       // tell it to continue
  166.     }
  167.    else if (stat == t9)                 // PCB asked if it scans
  168.     {                                   // for new mail since
  169.      delay(3);                          // last read.
  170.      cputs(PCB_mailscan);               // send defined constant
  171.      cputs("^M");                       // terminate string
  172.     }
  173.    else if (stat == t7)                 // Time to Open ProDoor
  174.     {
  175.      delay(1);
  176.      if (prodoor_loc == "NONE")         // if no ProDoor on line
  177.       {
  178.        return;                          // abort logon
  179.       }
  180.      cputs(prodoor_loc);                // tell it OPEN ProDoor
  181.      cputs("^M");                       // terminate string
  182.      while (not time_up(tmark))         // begin nested time loop
  183.       {
  184.        terminal();
  185.        stat = track_hit(0);               // start retrack
  186.  
  187.        if (stat == t5)                    // Again, stop More:
  188.         {
  189.          delay(1);
  190.          cputs("N^M");
  191.         }
  192.        else if (stat == t6)               // Stop continue in
  193.                                           // ProDoor
  194.         {
  195.          delay(1);
  196.          cputs("^M");
  197.         }
  198.        else if (stat == t8)               // found ProDoor
  199.                                           // welcome screen
  200.         {
  201.          cputs("^K^M");                   // so abort it
  202.         }
  203.        else if (stat == t7)             // ProDoor Command 
  204.         {                               // Prompt is found
  205.          delay(3);
  206.          cputs("r^M");                  // Drop to read mail
  207.          delay(1);
  208.          cputs("^M");
  209.          break;                         // done with logon
  210.         }
  211.       }
  212.      break;
  213.     }
  214.   }
  215.  
  216.  timer_free(mail_scan);                 // free WBBS timer
  217.  timer_free(tmark);                     // free timer channel
  218.  track_free(0);                         // and all track channels
  219.  
  220.  
  221. }
  222.